<?php /* Smarty version 2.6.16, created on 2013-09-10 06:36:32
         compiled from ../templates/default//modules/myaccount/myservicelocation.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'base64_encode', '../templates/default//modules/myaccount/myservicelocation.tpl', 190, false),)), $this); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => $this->_tpl_vars['header_start'], 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
  echo '<link rel="stylesheet" type="text/css" href="';  echo $this->_tpl_vars['siteroot'];  echo '/templates/default/style/dashboard.css"><script src="';  echo $this->_tpl_vars['siteroot'];  echo '/includes/js/myaccount.js" type="text/javascript"></script><script src="';  echo $this->_tpl_vars['siteroot'];  echo '/includes/js/admin/ajax.js" type="text/javascript" ></script>'; ?>

<?php echo '
<script type="text/javascript">

function getSelectedCheckbox(buttonGroup) {
   // Go through all the check boxes. return an array of all the ones
   // that are selected (their position numbers). if no boxes were checked,
   // returned array will be empty (length will be zero)
   var retArr = new Array();
   var lastElement = 0;
   if (buttonGroup[0]) { // if the button group is an array (one check box is not an array)
      for (var i=0; i<buttonGroup.length; i++) {
         if (buttonGroup[i].selected) {
            retArr.length = lastElement;
            retArr[lastElement] = i;
            lastElement++;
         }
      }
   } else { // There is only one check box (it\'s not an array)
      if (buttonGroup.selected) { // if the one check box is checked
         retArr.length = lastElement;
         retArr[lastElement] = 0; // return zero as the only array value
      }
   }
   return retArr;
} // Ends the "getSelectedCheckbox" function
  
  function getSelectedCheckboxValue(buttonGroup) {
   // return an array of values selected in the check box group. if no boxes
   // were checked, returned array will be empty (length will be zero)
   var retArr = new Array(); // set up empty array for the return values
   var selectedItems = getSelectedCheckbox(buttonGroup);
   if (selectedItems.length != 0) { // if there was something selected
      retArr.length = selectedItems.length;
      for (var i=0; i<selectedItems.length; i++) {
         if (buttonGroup[selectedItems[i]]) { // Make sure it\'s an array
            retArr[i] = buttonGroup[selectedItems[i]].value;
         } else { // It\'s not an array (there\'s just one check box and it\'s selected)
            retArr[i] = buttonGroup.value;// return that value
         }
      }
   }
   return retArr;
}
function in_array(array, id) {
    for(var i=0;i<array.length;i++) {
		
        if(array[i] === id) {
            return true;
        }
    }
    return false;
}


function showJobType(){
//alert(document.getElementById("catname").value);
//var chk_arr = new Array();
//var checkBoxArr = getSelectedCheckboxValue(document.frmMngProfile.catname);	
//alert(checkBoxArr);
//document.getElementById(\'hidediv\').style.display=\'block\';
	
	var namecat = document.getElementsByName("catname[]");
	var newstr=\'\';
	var myArray=new Array(); 
	for(var i=0; i< namecat.length;i++)
	{
		var str =\'\';
		str = namecat.item(i).value;
		
		if(str !=\'\')
		{
			
			if(in_array(myArray, str))
			{
				i=i+1;
				document.getElementById("catname_"+i).value=\'\';
				alert("Please select different category!");
				return false;				
			}
			else
			{
				myArray[i] =str;
				if(newstr == \'\')
				{
					newstr=str;	
				}
				else
				{
					newstr = newstr+\',\'+str;	
				}
			}
			
		}
	}
//	alert(newstr);
	//return false;
//		var fl = 0;
//	var chk_arr = new Array();
//	var checkBoxArr = getSelectedCheckboxValue(document.frmTradesmanAdd.catname);	
	//alert(checkBoxArr);
	//document.getElementById(\'hidediv\').style.display=\'block\';
	ajax.sendrequest("GET",SITEROOT + "/modules/register/show_jobtype.php",{jid:newstr},"","isJobType");

	
	ajax.sendrequest("GET",SITEROOT + "/modules/register/show_jobtype.php",{jid:checkBoxArr},"","isJobType");
}

</script>
<script type="text/javascript"><!--
function numbersonly(e)
{		

	var unicode=e.charCode? e.charCode : e.keyCode;		
	//alert(unicode)
	if (unicode!=8 && unicode !=9  &&  unicode !=39 &&  unicode != 46 &&  unicode !=  34 )
	{ 	
		//if the key isn\'t the backspace,Tab key (which we should allow)
		if (unicode<48||unicode>57) //if not a number
			return false; //disable key press
	}
}



</script>
<script type="text/javascript" >
function testfunction()
{
	document.getElementById("submitbtn").style.display =\'none\';	
}
</script>

'; ?>


<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => $this->_tpl_vars['header_end'], 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

<body></body>
   <!-- MIDDLE CONTAIN GOES HERE -->
<section class="middle_portion">
	<section class="inner_head">Dashboard</section>
    <section class="inner_containstart">
    	<!-- dashboard Left Content Start -->
        	<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => $this->_tpl_vars['cms_left_content'], 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
        <!-- dashboard Left Content End -->
        <!-- dashboard Right Content Start -->
        	<section class="dash_right">            	                
            <?php if ($this->_tpl_vars['msg']): ?><span style="padding:10px"><?php echo $this->_tpl_vars['msg']; ?>
</span><?php endif; ?>
            	<section class="title_box">
                   <span class="lF"> <h4>My Service & location</h4></span> <!--<span class="rF" style="padding-top:10px;" >"Want to add more Trade Category? Update your Trade Category and Job Type – <a href="<?php echo $this->_tpl_vars['siteroot']; ?>
/myaccount/mytradecategory/">click here</a>" </span>-->
         
                    <section class="clear"></section>
                </section>
                <form method="post" action="" name="frmMngProfile" id="frmMngProfile" enctype="multipart/form-data">
                 <input type="hidden" name="hidden_userid" id="hidden_userid" value="<?php echo $this->_tpl_vars['userDetArray']['id']; ?>
" />
                 <input type="hidden" name="latlongArray" id="latlongArray" value="<?php echo $this->_tpl_vars['latlongArray']; ?>
" />
    			<input type="hidden" id="radiusdata" name="radiusdata" value="" />         
				<input type="hidden" id="centerpt" name="centerpt" value="" />
                
                
                <section class="profile_wrapp">
                  <!--  <dl>
                        <dt><label>Trade Category:  </label></dt>
                        <dd>
                        	<select class="select" name="catname" id="catname" onChange="showJobType(this.value);">
                                <option value="">Select trade category</option>
                                <?php unset($this->_sections['i']);
$this->_sections['i']['name'] = 'i';
$this->_sections['i']['loop'] = is_array($_loop=$this->_tpl_vars['newtradecategoryArray']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['i']['show'] = true;
$this->_sections['i']['max'] = $this->_sections['i']['loop'];
$this->_sections['i']['step'] = 1;
$this->_sections['i']['start'] = $this->_sections['i']['step'] > 0 ? 0 : $this->_sections['i']['loop']-1;
if ($this->_sections['i']['show']) {
    $this->_sections['i']['total'] = $this->_sections['i']['loop'];
    if ($this->_sections['i']['total'] == 0)
        $this->_sections['i']['show'] = false;
} else
    $this->_sections['i']['total'] = 0;
if ($this->_sections['i']['show']):

            for ($this->_sections['i']['index'] = $this->_sections['i']['start'], $this->_sections['i']['iteration'] = 1;
                 $this->_sections['i']['iteration'] <= $this->_sections['i']['total'];
                 $this->_sections['i']['index'] += $this->_sections['i']['step'], $this->_sections['i']['iteration']++):
$this->_sections['i']['rownum'] = $this->_sections['i']['iteration'];
$this->_sections['i']['index_prev'] = $this->_sections['i']['index'] - $this->_sections['i']['step'];
$this->_sections['i']['index_next'] = $this->_sections['i']['index'] + $this->_sections['i']['step'];
$this->_sections['i']['first']      = ($this->_sections['i']['iteration'] == 1);
$this->_sections['i']['last']       = ($this->_sections['i']['iteration'] == $this->_sections['i']['total']);
?>
                                    <option value="<?php echo $this->_tpl_vars['newtradecategoryArray'][$this->_sections['i']['index']]['id']; ?>
" <?php if ($this->_tpl_vars['userDetArray']['tradeid'] == $this->_tpl_vars['newtradecategoryArray'][$this->_sections['i']['index']]['id']): ?> selected="selected" <?php endif; ?>><?php echo $this->_tpl_vars['newtradecategoryArray'][$this->_sections['i']['index']]['trade_category']; ?>
</option>
                                <?php endfor; endif; ?> 
                            </select>
                        </dd>
                        <section class="clear"></section>
                    </dl>-->
                    
                    <input type="hidden" value="<?php echo $this->_tpl_vars['remainingcnttradeid']; ?>
" id="remainingcnttradeid" name="remainingcnttradeid" />
                    <input type="hidden" value="<?php echo $this->_tpl_vars['cnttradeid']; ?>
" id="feeratedivValue" name="feeratedivValue" />
                    <input type="hidden" name="feerateDiv" id="feerateDiv"  />
                  <dl style="min-height:205px;">
                        <dt><label>Trade Category:  </label></dt>
                        <dd>
	                        <div id = "feeratetable1" style="min-height:52px; height:auto; position:relative;">
                            <?php unset($this->_sections['l']);
$this->_sections['l']['name'] = 'l';
$this->_sections['l']['loop'] = is_array($_loop=$this->_tpl_vars['newtradearray']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['l']['show'] = true;
$this->_sections['l']['max'] = $this->_sections['l']['loop'];
$this->_sections['l']['step'] = 1;
$this->_sections['l']['start'] = $this->_sections['l']['step'] > 0 ? 0 : $this->_sections['l']['loop']-1;
if ($this->_sections['l']['show']) {
    $this->_sections['l']['total'] = $this->_sections['l']['loop'];
    if ($this->_sections['l']['total'] == 0)
        $this->_sections['l']['show'] = false;
} else
    $this->_sections['l']['total'] = 0;
if ($this->_sections['l']['show']):

            for ($this->_sections['l']['index'] = $this->_sections['l']['start'], $this->_sections['l']['iteration'] = 1;
                 $this->_sections['l']['iteration'] <= $this->_sections['l']['total'];
                 $this->_sections['l']['index'] += $this->_sections['l']['step'], $this->_sections['l']['iteration']++):
$this->_sections['l']['rownum'] = $this->_sections['l']['iteration'];
$this->_sections['l']['index_prev'] = $this->_sections['l']['index'] - $this->_sections['l']['step'];
$this->_sections['l']['index_next'] = $this->_sections['l']['index'] + $this->_sections['l']['step'];
$this->_sections['l']['first']      = ($this->_sections['l']['iteration'] == 1);
$this->_sections['l']['last']       = ($this->_sections['l']['iteration'] == $this->_sections['l']['total']);
?>
                            <?php if ($this->_tpl_vars['cnttradeid'] > 1): ?>
                            <a href="<?php echo $this->_tpl_vars['siteroot']; ?>
/myaccount/delete/<?php echo ((is_array($_tmp=$this->_tpl_vars['newtradearray'][$this->_sections['l']['index']])) ? $this->_run_mod_handler('base64_encode', true, $_tmp) : smarty_modifier_base64_encode($_tmp)); ?>
/myservicelocation" onClick="javascript:return confirm('Are you sure do you want to delete this Trade Category?');" class="xcross" title="Delete Trade Category" >X</a>
                            <?php endif; ?>
                        	<select class="select" name="catname[]" id="catname_<?php echo $this->_sections['l']['iteration']; ?>
" onChange="showJobType();" style="width:215px;">
                                <option value="">Select trade category</option>
                                <?php unset($this->_sections['i']);
$this->_sections['i']['name'] = 'i';
$this->_sections['i']['loop'] = is_array($_loop=$this->_tpl_vars['newtradecategoryArray']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['i']['show'] = true;
$this->_sections['i']['max'] = $this->_sections['i']['loop'];
$this->_sections['i']['step'] = 1;
$this->_sections['i']['start'] = $this->_sections['i']['step'] > 0 ? 0 : $this->_sections['i']['loop']-1;
if ($this->_sections['i']['show']) {
    $this->_sections['i']['total'] = $this->_sections['i']['loop'];
    if ($this->_sections['i']['total'] == 0)
        $this->_sections['i']['show'] = false;
} else
    $this->_sections['i']['total'] = 0;
if ($this->_sections['i']['show']):

            for ($this->_sections['i']['index'] = $this->_sections['i']['start'], $this->_sections['i']['iteration'] = 1;
                 $this->_sections['i']['iteration'] <= $this->_sections['i']['total'];
                 $this->_sections['i']['index'] += $this->_sections['i']['step'], $this->_sections['i']['iteration']++):
$this->_sections['i']['rownum'] = $this->_sections['i']['iteration'];
$this->_sections['i']['index_prev'] = $this->_sections['i']['index'] - $this->_sections['i']['step'];
$this->_sections['i']['index_next'] = $this->_sections['i']['index'] + $this->_sections['i']['step'];
$this->_sections['i']['first']      = ($this->_sections['i']['iteration'] == 1);
$this->_sections['i']['last']       = ($this->_sections['i']['iteration'] == $this->_sections['i']['total']);
?>
                                    <option value="<?php echo $this->_tpl_vars['newtradecategoryArray'][$this->_sections['i']['index']]['id']; ?>
" <?php if ($this->_tpl_vars['newtradecategoryArray'][$this->_sections['i']['index']]['id'] == $this->_tpl_vars['newtradearray'][$this->_sections['l']['index']]): ?> selected="selected" <?php endif; ?>><?php echo $this->_tpl_vars['newtradecategoryArray'][$this->_sections['i']['index']]['trade_category']; ?>
</option>
                                <?php endfor; endif; ?> 
                            </select><div style="min-height:12px;width:220px; float:left; height:auto;"></div>
                            <?php endfor; endif; ?>
                             <div class='clear'></div>
                         	</div>
                      <div >   
                             <a href="javascript:void(0);" onClick="addFixedRateRow();" class="blue_btn margintp_bt admore" >Add more trade </a>&nbsp;&nbsp; 
                			 <a href="javascript:void(0);" onClick="removeFixedRateRow();" class="org_btn admore dis" id="removeid">Remove</a>
                         
                          <div class='clear'></div></div>
                
                 
                    
                        </dd>
                        <section class="clear"></section>
                    </dl>
                         
               

                    <dl>
                        <dt><label>Job Type : </label></dt>
                        <dd>
                        	 <div id="isJobType">
                                <select class="select" multiple="multiple" name="jobtype[]" id="jobtype" style="height:250px;">                    	
                                    <?php unset($this->_sections['i']);
$this->_sections['i']['name'] = 'i';
$this->_sections['i']['loop'] = is_array($_loop=$this->_tpl_vars['tradejobtypeArray']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['i']['show'] = true;
$this->_sections['i']['max'] = $this->_sections['i']['loop'];
$this->_sections['i']['step'] = 1;
$this->_sections['i']['start'] = $this->_sections['i']['step'] > 0 ? 0 : $this->_sections['i']['loop']-1;
if ($this->_sections['i']['show']) {
    $this->_sections['i']['total'] = $this->_sections['i']['loop'];
    if ($this->_sections['i']['total'] == 0)
        $this->_sections['i']['show'] = false;
} else
    $this->_sections['i']['total'] = 0;
if ($this->_sections['i']['show']):

            for ($this->_sections['i']['index'] = $this->_sections['i']['start'], $this->_sections['i']['iteration'] = 1;
                 $this->_sections['i']['iteration'] <= $this->_sections['i']['total'];
                 $this->_sections['i']['index'] += $this->_sections['i']['step'], $this->_sections['i']['iteration']++):
$this->_sections['i']['rownum'] = $this->_sections['i']['iteration'];
$this->_sections['i']['index_prev'] = $this->_sections['i']['index'] - $this->_sections['i']['step'];
$this->_sections['i']['index_next'] = $this->_sections['i']['index'] + $this->_sections['i']['step'];
$this->_sections['i']['first']      = ($this->_sections['i']['iteration'] == 1);
$this->_sections['i']['last']       = ($this->_sections['i']['iteration'] == $this->_sections['i']['total']);
?>
                                        <option value="<?php echo $this->_tpl_vars['tradejobtypeArray'][$this->_sections['i']['index']]['id']; ?>
" <?php if ($this->_tpl_vars['tradejobtypeArray'][$this->_sections['i']['index']]['checked'] == 'select'): ?> selected="selected" <?php endif; ?>><?php echo $this->_tpl_vars['tradejobtypeArray'][$this->_sections['i']['index']]['trade_category']; ?>
</option>
                                    <?php endfor; endif; ?> 
                                </select>
                             </div>   
                             <div id="isnullJobType" style="display:none;">
                                <select class="select" multiple="multiple" style="height:auto;">                    	
                                    
                                </select>
                             </div>   
                        </dd>
                        <section class="clear"></section>
                    </dl>
                    <section class="clear"></section>
                    <dl>
                        <dt><label>Postal Code : </label></dt>
                        <dd><input type="text" class="input" name="googlesearch" id="googlesearch" value="<?php echo $this->_tpl_vars['userDetArray']['workarea']; ?>
"  />
                        							<div id="google_address_error" ></div>
                        </dd>
                        <section class="clear"></section>
                    </dl>
                    <dl>
                        <dt><label>Select one of Multiple States : </label></dt>
                        <dd>						
						<select class="select" name="state_id[]" id="state_id" style="width:160px; height:150px; float:left" multiple="multiple" >
						<?php unset($this->_sections['i']);
$this->_sections['i']['name'] = 'i';
$this->_sections['i']['loop'] = is_array($_loop=$this->_tpl_vars['stateArray']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['i']['show'] = true;
$this->_sections['i']['max'] = $this->_sections['i']['loop'];
$this->_sections['i']['step'] = 1;
$this->_sections['i']['start'] = $this->_sections['i']['step'] > 0 ? 0 : $this->_sections['i']['loop']-1;
if ($this->_sections['i']['show']) {
    $this->_sections['i']['total'] = $this->_sections['i']['loop'];
    if ($this->_sections['i']['total'] == 0)
        $this->_sections['i']['show'] = false;
} else
    $this->_sections['i']['total'] = 0;
if ($this->_sections['i']['show']):

            for ($this->_sections['i']['index'] = $this->_sections['i']['start'], $this->_sections['i']['iteration'] = 1;
                 $this->_sections['i']['iteration'] <= $this->_sections['i']['total'];
                 $this->_sections['i']['index'] += $this->_sections['i']['step'], $this->_sections['i']['iteration']++):
$this->_sections['i']['rownum'] = $this->_sections['i']['iteration'];
$this->_sections['i']['index_prev'] = $this->_sections['i']['index'] - $this->_sections['i']['step'];
$this->_sections['i']['index_next'] = $this->_sections['i']['index'] + $this->_sections['i']['step'];
$this->_sections['i']['first']      = ($this->_sections['i']['iteration'] == 1);
$this->_sections['i']['last']       = ($this->_sections['i']['iteration'] == $this->_sections['i']['total']);
?>
						<option value="<?php echo $this->_tpl_vars['stateArray'][$this->_sections['i']['index']]['state_id']; ?>
" <?php unset($this->_sections['k']);
$this->_sections['k']['name'] = 'k';
$this->_sections['k']['loop'] = is_array($_loop=$this->_tpl_vars['getallradiusarea']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['k']['show'] = true;
$this->_sections['k']['max'] = $this->_sections['k']['loop'];
$this->_sections['k']['step'] = 1;
$this->_sections['k']['start'] = $this->_sections['k']['step'] > 0 ? 0 : $this->_sections['k']['loop']-1;
if ($this->_sections['k']['show']) {
    $this->_sections['k']['total'] = $this->_sections['k']['loop'];
    if ($this->_sections['k']['total'] == 0)
        $this->_sections['k']['show'] = false;
} else
    $this->_sections['k']['total'] = 0;
if ($this->_sections['k']['show']):

            for ($this->_sections['k']['index'] = $this->_sections['k']['start'], $this->_sections['k']['iteration'] = 1;
                 $this->_sections['k']['iteration'] <= $this->_sections['k']['total'];
                 $this->_sections['k']['index'] += $this->_sections['k']['step'], $this->_sections['k']['iteration']++):
$this->_sections['k']['rownum'] = $this->_sections['k']['iteration'];
$this->_sections['k']['index_prev'] = $this->_sections['k']['index'] - $this->_sections['k']['step'];
$this->_sections['k']['index_next'] = $this->_sections['k']['index'] + $this->_sections['k']['step'];
$this->_sections['k']['first']      = ($this->_sections['k']['iteration'] == 1);
$this->_sections['k']['last']       = ($this->_sections['k']['iteration'] == $this->_sections['k']['total']);
 if ($this->_tpl_vars['getallradiusarea'][$this->_sections['k']['index']]['state_id'] == $this->_tpl_vars['stateArray'][$this->_sections['i']['index']]['state_id']): ?> selected="selected"  <?php endif;  endfor; endif; ?>><?php echo $this->_tpl_vars['stateArray'][$this->_sections['i']['index']]['state_name']; ?>
</option>
						<?php endfor; endif; ?>
						</select>
	                       	   
                        <section class="clear"></section>
                        </dd>
                        <section class="clear"></section>
                        
                    </dl>
                    <section class="clear"></section>
                  <div id="distance"></div>
              
                <div id="submitbtn" >
                <section class="bt_save_wrapp" style="margin-bottom:20px;">
                    	<input type="submit" value="Save" name="save_btn" id="save_btn" class="bt_save"/>
                        <input type="button" value="Cancel" name="cancel_btn" id="cancel_btn" class="bt_save" <?php if ($_SESSION['user_type'] == '3'): ?> onclick="window.location.href='<?php echo $this->_tpl_vars['siteroot']; ?>
/myaccount/'" <?php else: ?> onclick="window.location.href='<?php echo $this->_tpl_vars['siteroot']; ?>
/profile/<?php echo $this->_tpl_vars['userDetArray']['newcomapnyname']; ?>
'" <?php endif; ?>/>
                </section>
                </div>    
                </section>                
                </form> 
            </section>
        <!-- dashboard Right Content End -->
        	<section class="clear"></section>
    </section>
</section>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => $this->_tpl_vars['footer'], 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>